script_name="添加遮罩"
script_description="在指定的对白下添加遮罩"
script_author="旺旺"
script_version="1.2"
script_last_update_date="2013/11/30"

--界面设置
dialog_config =
{
	[2]={class="label",x=2,y=0,label="这个牛逼的脚本可以让你在添加遮罩时思考一下人生"},
	[3]={class="label",x=0,y=1,label="要添加的遮罩内容"},
	[4]={class="edit",name="mask",x=1,y=1,width=3,height=1,text="style"},
}

function add_masks(subs, sel)
	buttons, results = aegisub.dialog.display(dialog_config,{"OK", "Cancel"});	
	local mask = results["mask"]
    for z, k in pairs(sel) do
        local mask_line = subs[k]
        mask_line.text = mask
        subs.append(mask_line)
    end
    aegisub.set_undo_point(script_name);
end

function script_main(subs, sel)
	add_masks(subs, sel);
end

aegisub.register_macro(script_name,script_description,script_main)